﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;

namespace Al.UI.Controls
{
    public delegate void DataChangedEventHandler(DataChangedEventArgs e);

    public class DataChangedEventArgs : EventArgs
    {
        public DateTime Data;
        public DataChangedEventArgs()
        {
            Data = DateTime.Now;
        }
    }

    public class RandomDataProvider
    {
        public static DataChangedEventHandler DataChanged;
        private static Timer timer;

        static RandomDataProvider()
        {
            timer = new Timer(5000);
            timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
        }

        static void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            if (DataChanged != null)
            {
                DataChanged(new DataChangedEventArgs());
            }
        }
    }
}
